﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ashlen.Portal.Core;
using Ashlen.Portal.Core.DTO;

namespace Ashlen.Portal.Core.DataInterfaces
{
    public interface IWidgetDao
    {
        #region Widget
        object SelectWidget(Guid? id, string name);

        Guid CreateWidget(object widget);

        Guid CreateWidget(string name, string url, string desc, int version, string author, bool isDefault,
                            string body, string defaultState, string icon, int orderNo, string userCreated);

        void UpdateWidget(Guid id, string name, string url, string desc, int version, string author, bool isDefault,
                    string body, string defaultState, string icon, int orderNo, string userUpdated);

        void DeleteWidget(Guid id);

        object SelectWidgets();
        #endregion

        #region Widget Instance
        object SelectWidgetInstance(Guid? widgetId, Guid? pageId);

        Guid CreateWidgetInstance(Guid widgetId, Guid pageId, int colNo, int orderNo, bool isExpanded, string title, string state,
                                    int version, string userCreated);

        void UpdateWidget(object widget);

        void UpdateWidgetInstance(Guid id, Guid widgetId, Guid pageId, int colNo, int orderNo, bool isExpanded, string title, string state,
                                    int version, string userUpdated);

        void DeleteWidgetInstance(Guid id);

        object SelectWidgets(Guid pageId);
        #endregion

        #region Page
        object SelectPage(string title, string username);

        object SelectPages(string username);

        Guid CreatePage(object page);

        Guid CreatePage(string title, Guid userId, int version, int layoutType, string userCreated);

        object CreatePage(string title, string username, int version, int layoutType, string userCreated);

        void UpdatePage(object page);

        void UpdatePage(Guid id, string title, Guid userId, int version, int layoutType, string userUpdated);

        void UpdatePage(Guid id, string title, string username, int layoutId);

        void DeletePage(Guid id);
        #endregion
    }
}
